home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / • Extras • / Contextual Menu Headers / AbstractCMPlugin.xh < prev    next >
Text File  |  1997-03-20  |  5KB  |  180 lines

  1. /*
  2.  * This file was generated by the SOM Compiler.
  3.  * FileName: Sources:NRSources:ContextualMenu:Modules:AbstractCMPlugin:AbstractCMPlugin.xh.
  4.  * Generated using:
  5.  *     SOM Precompiler somipc: 2.18
  6.  *     SOM Emitter emitxh.dll: 2.33
  7.  */
  8.  
  9. #ifndef SOM_AbstractCMPlugin_xh
  10. #define SOM_AbstractCMPlugin_xh
  11.  
  12. class AbstractCMPlugin;
  13.  
  14. #define AbstractCMPlugin_MajorVersion 0
  15. #define AbstractCMPlugin_MinorVersion 0
  16.  
  17. /*
  18.  * Passthru lines: File: "C.xh", "before"
  19.  */
  20. #include <Types.h>
  21. #include <Files.h>
  22. #include <AppleEvents.h>
  23.  
  24. /* C++ SOM defs */
  25. #include <somcls.xh>
  26. #include <somcm.xh>
  27.  
  28. /* C++ parent defs */
  29. #ifndef SOM_SOMObject_xh
  30. #include <somobj.xh>
  31. #endif
  32.  
  33. #ifndef AbstractCMPlugin_API
  34. #define AbstractCMPlugin_API
  35. /*
  36.  * -- The Class API
  37.  */
  38.  
  39. /*
  40.  * Start of user-defined types:
  41.  */
  42. class SOMClass;
  43. class SOMObject;
  44.  
  45. /*
  46.  * End of user-defined types.
  47.  */
  48.  
  49. #ifdef OLDIBMSOMAPISUPPORT
  50. #define AbstractCMPluginCClassData AbstractCMPluginClassData
  51. #define AbstractCMPluginNewClass(major,minor) somNewVersionedClassReference(AbstractCMPlugin,major,minor)
  52. #endif
  53.  
  54. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  55. #define AbstractCMPluginMetaClass SOMClass
  56.  
  57.  
  58. /* The API to the AbstractCMPlugin class object, and the methods it introduces. */
  59. SOMEXTERN struct AbstractCMPluginClassDataStructure {
  60. #ifdef OLDIBMSOMAPISUPPORT
  61.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  62. #else
  63.     long zero;
  64. #endif
  65.     somStaticClassInfo *sci;
  66.     somDToken        instanceDataToken;
  67.     long reserved [3];
  68.     somMToken Initialize;
  69.     somMToken ExamineContext;
  70.     somMToken HandleSelection;
  71.     somMToken PostMenuCleanup;
  72. } SOMDLINK AbstractCMPluginClassData;
  73.  
  74. #if !defined(AbstractCMPlugin_Class_Source) && !defined(SOM_Module_abstractcmplugin_Source)
  75. #if PRAGMA_IMPORT_SUPPORTED
  76. #pragma import list AbstractCMPluginClassData
  77. #endif
  78. #endif
  79.  
  80.  
  81. /*
  82.  * -- Typedefs and inline method declarations for left path inherited methods
  83.  * -- are omitted because this compilation had -museinheritedmethods in effect
  84.  */
  85.  
  86.  
  87. /*
  88.  * -- Typedefs for AbstractCMPlugin Method Procedures
  89.  */
  90. SOMEXTERN {
  91. typedef OSStatus   (* SOMLINK somTD_AbstractCMPlugin_Initialize)(AbstractCMPlugin *somSelf, Environment *ev,
  92.         FSSpec* inFileSpec);
  93. typedef OSStatus   (* SOMLINK somTD_AbstractCMPlugin_ExamineContext)(AbstractCMPlugin *somSelf, Environment *ev,
  94.         AEDesc* inContextDescriptor,
  95.         SInt32 inTimeOutInTicks,
  96.         AEDescList* ioCommands,
  97.         boolean* outNeedMoreTime);
  98. typedef OSStatus   (* SOMLINK somTD_AbstractCMPlugin_HandleSelection)(AbstractCMPlugin *somSelf, Environment *ev,
  99.         AEDesc* inContextDescriptor,
  100.         SInt32 inCommandID);
  101. typedef OSStatus   (* SOMLINK somTD_AbstractCMPlugin_PostMenuCleanup)(AbstractCMPlugin *somSelf, Environment *ev);
  102. }
  103.  
  104. #endif /* AbstractCMPlugin_API */
  105.  
  106.  
  107. /*
  108.  * -- This emitter treats Method Tokens as Thunks by default.
  109.  * -- Use the sc modifier "nothunks" to change this default
  110.  */
  111. #undef somresolve_
  112. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  113.  
  114. /*
  115.  * -- The C++ Wrapper Class for AbstractCMPlugin
  116.  */
  117. class AbstractCMPlugin : public SOMObject
  118. {
  119. public:
  120.  
  121. // AbstractCMPlugin::new registers use of the class object, and then uses somNew
  122. // to allocate memory and load the object method table pointer. 
  123. void *operator new(size_t size)
  124. {
  125.     SOM_IgnoreWarning(size);
  126.     // Allocate memory using the default allocator for AbstractCMPlugin, and
  127.     // clear mem & set method table pointer, call basic initialization
  128.     return (void*) somNewObject(AbstractCMPlugin);
  129. }
  130.  
  131. // AbstractCMPlugin::delete uses the default deallocator for the object's class.
  132. void operator delete(void * obj)
  133. {
  134.     if (obj) {
  135.         SOM_Resolve(obj,SOMObject,somFree)
  136.            ( (SOMObject*) obj );
  137.     }
  138. }
  139.  
  140. /* method: Initialize */
  141. OSStatus   Initialize(Environment *ev,
  142.         FSSpec* inFileSpec)
  143. {
  144.    return SOM_ResolveD(this,AbstractCMPlugin,AbstractCMPlugin,Initialize)
  145.     (this,ev,inFileSpec);
  146. }
  147.  
  148. /* method: ExamineContext */
  149. OSStatus   ExamineContext(Environment *ev,
  150.         AEDesc* inContextDescriptor,
  151.         SInt32 inTimeOutInTicks,
  152.         AEDescList* ioCommands,
  153.         boolean* outNeedMoreTime)
  154. {
  155.    return SOM_ResolveD(this,AbstractCMPlugin,AbstractCMPlugin,ExamineContext)
  156.     (this,ev,inContextDescriptor,inTimeOutInTicks,ioCommands,outNeedMoreTime);
  157. }
  158.  
  159. /* method: HandleSelection */
  160. OSStatus   HandleSelection(Environment *ev,
  161.         AEDesc* inContextDescriptor,
  162.         SInt32 inCommandID)
  163. {
  164.    return SOM_ResolveD(this,AbstractCMPlugin,AbstractCMPlugin,HandleSelection)
  165.     (this,ev,inContextDescriptor,inCommandID);
  166. }
  167.  
  168. /* method: PostMenuCleanup */
  169. OSStatus   PostMenuCleanup(Environment *ev)
  170. {
  171.    return SOM_ResolveD(this,AbstractCMPlugin,AbstractCMPlugin,PostMenuCleanup)
  172.     (this,ev);
  173. }
  174.  
  175. };   /* AbstractCMPlugin */
  176.  
  177.  
  178.  
  179. #endif       /* SOM_AbstractCMPlugin_xh */
  180.